/*
* 路由
* */
import Home from 'pages/Home'
import Search from 'pages/Search'
import Category from 'pages/Category'
import SubCategories from 'pages/Category/SubCategories'
import Topic from 'pages/Topic'
import TopicContent from 'pages/Topic/Contents'
import Expert from 'pages/Expert'
import Shopcart from 'pages/ShopCart'
import Profile from 'pages/Profile'
import LogCenter  from 'profile/logCenter'
import LogByPhone   from 'profile/logByPhone'
import LogByEmail   from 'profile/logByEmail'
import RegByPhone   from 'profile/regByPhone'
import RegByEmail   from 'profile/regByEmail'

const routes = [
  {path: '/home', component: Home},
  {path: '/search', component: Search},
  {path: '/category', component: Category,children:[
      {
        path:'subCategory',
        component:SubCategories,
        props(route){
          return{
            id:route.query.id
          }
        }
      },
      {path:'/category',redirect:'subCategory'}
    ]},
  {path: '/topic',component: Topic,
    children:[
      {path:'tab/:id',name:'tab',component:TopicContent}
    ]},
  {path: '/expert', component: Expert},
  {path: '/shopcart', component: Shopcart},
  {path: '/profile', component: Profile,
    children:[
      {path: 'logcenter', component:LogCenter,  meta:{isHeadShow:true}  },
      {path: 'logbyphone',component:LogByPhone, meta:{isHeadShow:true}  },
      {path: 'logbyemail',component:LogByEmail, meta:{isHeadShow:true}  },
      {path: 'regbyphone',component:RegByPhone, meta:{isHeadShow:true}  },
      {path: 'regbyemail',component:RegByEmail, meta:{isHeadShow:false} },
      {path: '/profile',redirect: '/profile/logcenter'}
    ]
  },
  {path: '/', redirect: '/home'}
]

export default routes

